<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    function Obj() {
        
    }
    //原型对象prototype所有对象的实例都可访问到
    var mc = new Obj();
    mc.name = "zhangsan";
    var mc2 = new Obj();
    console.log(Obj.prototype)
    console.log(mc.__proto__ == Obj.prototype);
    //可使用hasOwnProperty来判断对象自身是否含有该属性
    console.log(mc.hasOwnProperty("name"));
    mc.toString = function(){
        return "hahahaha";
    };
    console.log(mc.toString());
    //gc垃圾回收只需将对象的引用转向null即可
</script>
<body>
    
</body>
</html>